using NetTopologySuite.Features;
using NetTopologySuite.Geometries;

namespace ZMap.Render
{
    /// <summary>
    /// src/ol/render/Feature.js
    /// </summary>
    public class RenderFeature
    {
        private readonly Feature _feature;
        private Coordinate[] _flatCoordinates;

        public RenderFeature(Feature feature, object id)
        {
            _feature = feature;
            Id = id;
        }

        /// <summary>
        /// 
        /// </summary>
        public Envelope Extent
        {
            get
            {
                if (_feature.BoundingBox == null)
                {
                }

                return _feature.BoundingBox;
            }
        }

        public IAttributesTable Properties => _feature.Attributes;

        public object Id { get; }

        public Coordinate[] FlatCoordinates
        {
            get
            {
                if (_flatCoordinates == null)
                {
                    // todo:
                    _flatCoordinates = new Coordinate[0];
                }

                return _flatCoordinates;
            }
        }
    }
}